package touhou.entity;

import gameframework.base.Drawable;
import gameframework.base.DrawableImage;

import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.Rectangle;

import touhou.game.GameMovable;
import touhou.base.Entity;
import touhou.base.Overlappable;
import touhou.game.Projectile;

/**
 * Projectile des ennemis.
 */
public class Bubble extends GameMovable implements Drawable, Entity,
Overlappable, Projectile {
	protected static DrawableImage image = null;
	public static int RENDERING_SIZE = 24;
	protected static boolean movable = true;
	private static int damage = 5;
	public int id;
	protected static int ID = 0;

	public Bubble(Canvas canvas) {
		id = ID++;
		if (image == null) {
			image = new DrawableImage("images/pacgum.gif", canvas);
		}
	}
	
	public void setDamage(int damage) {
		Bubble.damage = damage;
	}

	@Override
	public Rectangle getBoundingBox() {
		return (new Rectangle((int) getPosition().getX()+RENDERING_SIZE/4, (int) getPosition().getY()+RENDERING_SIZE/4,
				RENDERING_SIZE/2, RENDERING_SIZE/2));
	}

	@Override
	public void draw(Graphics g) {
		g.drawImage(image.getImage(), (int) getPosition().getX(),
				(int) getPosition().getY(), RENDERING_SIZE, RENDERING_SIZE,
				null);
		//g.drawRect((int)getPosition().getX()+RENDERING_SIZE/4, (int)getPosition().getY()+RENDERING_SIZE/4, RENDERING_SIZE/2, RENDERING_SIZE/2);
	}

	@Override
	public void oneStepMoveAddedBehavior() {
		
	}

	
	public int getDamage() {
		return damage;
	}
}
